package prototype_pattern.demo;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liwuji
 * @date 2024/1/17
 * @desc
 **/
public class Cache {
    private static final Map<String, User> cacheMap = new HashMap<>(15);
    private volatile static Cache cache;

    private Cache() {
    }

    public Cache getInstance() {
        if (null == cache) {
            synchronized (Cache.class) {
                if (null == cache) {
                    cache = new Cache();
                }
                return cache;

            }
        }
        return cache;
    }
    public void add(User user){
        
    }
}
